import { presetUno } from 'unocss';
import Unocss from 'unocss/vite';

export function unocss () {
  return Unocss({
    presets: [
      presetUno()
    ],
    blocklist: ['container'],
    rules: [
      [
        'p-safe',
        {
          padding:
            'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)'
        }
      ],
      ['pt-safe', { 'padding-top': 'env(safe-area-inset-top)' }],
      ['pb-safe', { 'padding-bottom': 'env(safe-area-inset-bottom)' }],
      ['flex-center', { display: 'flex', 'justify-content': 'center', 'align-items': 'center' }],
      ['align-start', { 'align-items': 'flex-start' }],
      ['align-end', { 'align-items': 'flex-end' }],
      ['align-center', { 'align-items': 'center' }],
      ['align-baseline', { 'align-items': 'baseline' }],
      ['fl', { 'float': 'left' }],
      ['fr', { 'float': 'right' }]
    ]
  });
}
